package com.randi.web.controller.system;

import com.github.pagehelper.PageInfo;
import com.randi.common.core.domain.Result;
import com.randi.common.core.domain.entity.SysUser;
import com.randi.system.domain.params.SysUserParam;
import com.randi.system.service.sysNotice.ISysNoticePushService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("system/notice/push")
@Api(tags = "公告推送")
public class SysNoticePushController {

    @Resource
    private ISysNoticePushService iSysNoticePushService;

    /**
     * 分页获取推送用户列表
     *
     * @param sysUserParam 检索参数
     * @return Result
     */
    @PostMapping("/user/list")
    @ApiOperation(value = "获取推送用户列表", notes = "")
    @PreAuthorize("@auth.hasPermission('system:notice:list')")
    public Result selectList(@RequestBody SysUserParam sysUserParam) {
        PageInfo<SysUser> sysUserPageInfo = iSysNoticePushService.selectUserPageList(sysUserParam);
        return Result.success().putPage(sysUserPageInfo);
    }

}
